#include <stdio.h>
#include <stdlib.h>

#define MSG_LEN 56000000
#define RW 1048576
#define ACK_LEN 16
#define MAX_KEYSIZE 1000
#define BUF_SIZE 1024
#define MIN(A,B) (A)<(B)?(A):(B)

char* workerId2workerFile(int workerId) {
	char* workerFile = (char*)malloc(sizeof(char) * 100);
	sprintf(workerFile, "1server-inception/4worker/keyorder_gpu%d.data", workerId);
	return workerFile;
}


int readSize(int* keySize) {
	FILE* inf;
	int keyCnt;
	inf = fopen("1server-inception/key_size.txt", "r");
	fscanf(inf, "%d", &keyCnt);
	int j;
	for (int i = 0; i < keyCnt; i++) {
		fscanf(inf, "%d%d", &j, &keySize[i]);
	}
	fclose(inf);
	return keyCnt;
}
int readIdList(int* keyIdList, int len, char* filePath) {
	FILE* inf;
	inf = fopen(filePath, "r");
	for (int i = 0; i < len; i++) {
		fscanf(inf, "%d", &keyIdList[i]);
	}
	fclose(inf);
	return 0;
}
